using System;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace LayoutPlanning.Model
{
    [Serializable]
    public class GraficalObstacle : GraficalObject
    {
        
        public GraficalObstacle(System.Windows.Point startPoint, System.Windows.Point endPoint)
        {
          
            var x = Math.Min(endPoint.X, startPoint.X);
            var y = Math.Min(endPoint.Y, startPoint.Y);

            var w = Math.Max(endPoint.X, startPoint.X) - x;
            var h = Math.Max(endPoint.Y, startPoint.Y) - y;

         
            ControlType = ControlType.Square;
            // Control = new SerializableFrameworkElement( new ContentControl() {Content =  rect});


            SizeX = w;
            SizeY = h;
        }

        public override Task<GraficalObject> Copy()
        {
            return null;
        }
    }
}